import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;

/**
 * @ClassName A5
 * @Description
 * @Author Jingxiao.Ye
 * @Date 2021/11/28 下午11:23
 * @Version V1.0
 * @Since JDK 11
 */
public class A5 {

    public static void main(String[] args) throws InterruptedException {
        AtomicInteger atomicInteger = new AtomicInteger();
        Object o = new Object();

        Thread thread = new Thread(() -> {
            try {
                Integer call = new Task().call();
                atomicInteger.set(call);
                synchronized (o){
                    o.notify();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        thread.start();
        synchronized (o){
            o.wait();
        }
        System.out.println(atomicInteger.get());
    }
}
